<template>
    <div class="hotel-card">
      <van-image 
        :src="data.image" 
        height="120" 
        radius="6"
      />
      <div class="info">
        <h3 class="title">{{ data.name }}</h3>
        <div class="tags">
          <van-tag 
            v-for="(tag, index) in data.tags" 
            :key="index" 
            type="primary" 
            size="small"
          >
            {{ tag }}
          </van-tag>
        </div>
        <div class="bottom">
          <div class="rating">
            <van-rate 
              v-model="data.rating" 
              readonly 
              allow-half 
              :size="14" 
            />
            <span class="score">{{ data.rating }}</span>
          </div>
          <div class="price">
            <span class="symbol">¥</span>
            <span class="number">{{ data.price }}</span>
            <span class="unit">起</span>
          </div>
        </div>
      </div>
    </div>
  </template>
  
  <script setup>
  defineProps({
    data: {
      type: Object,
      required: true
    }
  });
  </script>
  
  <style scoped>
  .hotel-card {
    background: white;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
  }
  
  .info {
    padding: 12px;
  }
  
  .title {
    margin: 0 0 8px;
    font-size: 16px;
    color: #333;
  }
  
  .tags {
    margin-bottom: 12px;
    
    .van-tag {
      margin-right: 6px;
    }
  }
  
  .bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .rating {
    display: flex;
    align-items: center;
    
    .score {
      color: #ff9a0d;
      margin-left: 6px;
      font-weight: bold;
    }
  }
  
  .price {
    color: #f44;
    
    .symbol {
      font-size: 12px;
    }
    
    .number {
      font-size: 18px;
      font-weight: bold;
    }
    
    .unit {
      font-size: 12px;
      color: #999;
    }
  }
  </style>
  